package com.ruoyi.receipt.utils;

import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.receipt.context.UserContextHolder;
import com.ruoyi.receipt.domain.TbUser;

import static com.ruoyi.common.utils.reflect.ReflectUtils.setFieldValue;

/**
 * 获取手机端当前用户
 * 
 * @author chenjian
 */
public class CurrentUserUtils
{
    public static TbUser getCurrentUser()
    {
        TbUser tbUser= UserContextHolder.getUser();
        if(null==tbUser){
            throw new CustomException("请先登录",401);
        }
        return tbUser;
    }
}
